package com.ra.landlord;

import java.io.File;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import com.googlecode.cswish.annotation.cm;

@Entity
public class RoomAttachment {

	private Integer id;
	
	private Room room;
	
	@cm("类型")
	// 图片, 微视频等
	private Integer contentType;
	
	// transient
	private File attachment;
	
	// transient
	private String attachmentContentType;
	
	@cm("附件名")
	private String attachmentFileName;

	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	public Integer getContentType() {
		return contentType;
	}

	public void setContentType(Integer contentType) {
		this.contentType = contentType;
	}

	@Transient
	public File getAttachment() {
		return attachment;
	}

	public void setAttachment(File doc) {
		this.attachment = doc;
	}

	@Transient
	public String getAttachmentContentType() {
		return attachmentContentType;
	}

	public void setAttachmentContentType(String docContentType) {
		this.attachmentContentType = docContentType;
	}
	
	public String getAttachmentFileName() {
		return attachmentFileName;
	}

	public void setAttachmentFileName(String docFileName) {
		this.attachmentFileName = docFileName;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	public Room getRoom() {
		return room;
	}

	public void setRoom(Room room) {
		this.room = room;
	}
}
